#!/bin/sh

# usage: sh errorReporter.sh log_file.log

# assumptions: this file is `flock`ed before being executed. no other files
#  read or written to in this script are accessed concurrently

errorLog="../common/report/errors"


# print current date time to error log
date +%m-%d-%H-%M >> $errorLog

# print the present working directory (most like the folder of the manager script 
#  which called this one) to error log
pwd >> $errorLog

# append ignore and error messages from log file to error log
#DISABLED grep -i "ignoring" $1 >> $errorLog
grep -i "error" $1 | grep -v "Error: *[0-9]" >> $errorLog

echo >> $errorLog
